﻿using System;
using System.Data;

namespace BizElements.Core
{
    /// <summary>Provides values for immutable <see cref="IDbTable"/> properties.</summary>
    public interface IDbTableConfiguration
    {
        #region Properties.

        /// <summary>Gets catalog information to which the table/view belongs to.</summary>
        ICatalog Catalog { get; }

        /// <summary>Gets table name.</summary>
        string TableName { get; }

        /// <summary>Gets column configuration.</summary>
        IDbColumnConfiguration[] Columns { get; }

        /// <summary>Gets primary key column indexes in <see cref="Columns"/> array.</summary>
        int[] PrimaryKeyColumnIndexes { get; }

        /// <summary>Gets the names parent entity properties in generated <see cref="IEntity"/> class.</summary>
        string[] ParentEntityProperties { get; }

        /// <summary>Gets the collection of customized information associated with the table.</summary>
        /// <value>A IPropertyCollection with all custom information. <b>null</b> if no custom information is configured.</value>
        /// <remarks>The ExtendedProperties property lets you configure custom information for the table such as DBMS-specific properties.</remarks>
        IPropertyCollection<string> ExtendedProperties { get; }

        /// <summary>Indicates whether the database object is a view.</summary>
        /// <value><b>true</b> if object is a view; otherwise <b>false</b></value>
        bool IsView { get; }

        /// <summary>Gets foreign key configuration.</summary>
        IDbRelationConfiguration[] ForeignKeys { get; }

        #endregion
    }
}